package com.shop2cn.iapi.livebuyer.service;

import java.util.ArrayList;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymatou.iapi.godmch.parameter.RoleDto;
import com.ymatou.iapi.livebuyer.parameter.NotSpeakingItemDto;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*查询云通讯全局禁言
*FreeMaker Template自动生成代码
*/
public class GetNotSpeekingListCall extends YmatouBaseCall{
	private static String opurl ="api/GetNotSpeekingList";
	
	public GetNotSpeekingListCall() {
		super(EnvSetup.getSystemUrl("livebuyer_iapi_shop2cn"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public ArrayList<NotSpeakingItemDto> getNotSpeakingItemDtos() {
		ArrayList<NotSpeakingItemDto> result =new ArrayList<NotSpeakingItemDto>();
		try {
			result = (ArrayList<NotSpeakingItemDto>) new Gson().fromJson(getJsonObject().get("data").getAsJsonObject().get("notSpeakingItemList").getAsJsonArray().toString(), new TypeToken<ArrayList<NotSpeakingItemDto>>() {}.getType());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
}